inherited fmVybyvshieDeti: TfmVybyvshieDeti
  Left = 348
  Top = 390
  Width = 1178
  Height = 518
  Caption = 'fmVybyvshieDeti'
  Constraints.MinHeight = 518
  Constraints.MinWidth = 1070
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object dbgPeopleFind: TcxGrid [0]
    Left = 0
    Top = 72
    Width = 1162
    Height = 264
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 3
    LookAndFeel.Kind = lfStandard
    LookAndFeel.SkinName = 'Blue'
    object tvPeopleFind: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Enabled = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Kind = skCount
          FieldName = 'PID'
          Column = tvPeopleFindPID
          DisplayText = #1042#1089#1077#1075#1086' '#1085#1072#1081#1076#1077#1085#1086' '#1089#1086#1080#1089#1082#1072#1090#1077#1083#1077#1081
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.FocusFirstCellOnNewRecord = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.CancelOnExit = False
      OptionsData.Deleting = False
      OptionsData.DeletingConfirmation = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 5
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.CellAutoHeight = True
      OptionsView.CellTextMaxLineCount = 1
      OptionsView.ColumnAutoWidth = True
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.HeaderEndEllipsis = True
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxGreenText
      Styles.Header = DMInv.cxSiniyText
      object tvPeopleFindPID: TcxGridDBColumn
        DataBinding.FieldName = 'PID'
        Width = 24
      end
      object tvPeopleFindPLASTNAME: TcxGridDBColumn
        Caption = #1060#1072#1084#1080#1083#1080#1103
        DataBinding.FieldName = 'PLASTNAME'
        Width = 50
      end
      object tvPeopleFindPNAME: TcxGridDBColumn
        Caption = #1048#1084#1103
        DataBinding.FieldName = 'PNAME'
        Width = 25
      end
      object tvPeopleFindPPATRONYMIC: TcxGridDBColumn
        Caption = #1054#1090#1095#1077#1089#1090#1074#1086
        DataBinding.FieldName = 'PPATRONYMIC'
        Width = 55
      end
      object tvPeopleFindPDATEBIRTH: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076'.'
        DataBinding.FieldName = 'PDATEBIRTH'
        Width = 67
      end
      object tvPeopleFindLET: TcxGridDBColumn
        Caption = #1051#1077#1090
        DataBinding.FieldName = 'LET'
        Width = 25
      end
      object tvPeopleFindMES: TcxGridDBColumn
        Caption = #1052#1077#1089
        DataBinding.FieldName = 'MES'
        Width = 24
      end
      object tvPeopleFindOSN_PODR: TcxGridDBColumn
        Caption = #1055#1086#1076#1088#1072#1079#1076' '#1085#1072' '#1076#1072#1090#1091' '#1091#1095#1077#1073#1099
        DataBinding.FieldName = 'OSN_PODR'
        Width = 131
      end
      object tvPeopleFindAGID: TcxGridDBColumn
        Caption = #8470' '#1076#1086#1075'.'
        DataBinding.FieldName = 'AGID'
        Width = 44
      end
      object tvPeopleFindAGDATEBEGIN: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1085#1072#1095'. '#1076#1086#1075'.'
        DataBinding.FieldName = 'AGDATEBEGIN'
        Width = 83
      end
      object tvPeopleFindAGDATEEND: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1086#1082#1086#1085#1095'. '#1076#1086#1075'.'
        DataBinding.FieldName = 'AGDATEEND'
        Width = 96
      end
      object tvPeopleFindAGR_TYPE: TcxGridDBColumn
        Caption = #1058#1080#1087' '#1076#1086#1075'.'
        DataBinding.FieldName = 'AGR_TYPE'
        Width = 48
      end
    end
    object dbgPeopleFindLevel1: TcxGridLevel
      GridView = tvPeopleFind
    end
  end
  inherited sbBottom: TStatusBar
    Top = 453
    Width = 1162
  end
  inherited Panel1: TPanel
    Width = 1162
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 987
    end
    inherited BitBtn2: TBitBtn
      Left = 1075
    end
  end
  object dxBarDockControl1: TdxBarDockControl [3]
    Left = 0
    Top = 45
    Width = 1162
    Height = 27
    Align = dalTop
    BarManager = dxBarManager1
  end
  object sqlMemo: TcxMemo [4]
    Left = 0
    Top = 336
    Align = alBottom
    Lines.Strings = (
      'sqlMemo')
    Properties.ScrollBars = ssVertical
    Style.LookAndFeel.SkinName = 'Office2007Blue'
    StyleDisabled.LookAndFeel.SkinName = 'Office2007Blue'
    StyleFocused.LookAndFeel.SkinName = 'Office2007Blue'
    StyleHot.LookAndFeel.SkinName = 'Office2007Blue'
    TabOrder = 8
    Visible = False
    Height = 117
    Width = 1162
  end
  inherited dlgDS: TDataSource
    DataSet = qPeople
  end
  object dxBarManager1: TdxBarManager
    AllowReset = False
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'Segoe UI'
    Font.Style = []
    Categories.Strings = (
      'Default')
    Categories.ItemsVisibles = (
      2)
    Categories.Visibles = (
      True)
    ImageOptions.Images = DMInv.cxSmallImages
    LookAndFeel.SkinName = 'Blue'
    NotDocking = [dsNone, dsLeft, dsTop, dsRight, dsBottom]
    PopupMenuLinks = <>
    ShowHint = False
    Style = bmsUseLookAndFeel
    UseSystemFont = True
    Left = 520
    Top = 115
    DockControlHeights = (
      0
      0
      0
      0)
    object dxBarManager1Bar1: TdxBar
      AllowClose = False
      AllowCustomizing = False
      AllowQuickCustomizing = False
      AllowReset = False
      Caption = #1044#1072#1090#1072' '#1085#1072#1093#1086#1078#1076#1077#1085#1080#1103' '#1088#1077#1073#1077#1085#1082#1072' '#1074' '#1087#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1080
      CaptionButtons = <>
      DockControl = dxBarDockControl1
      DockedDockControl = dxBarDockControl1
      DockedLeft = 0
      DockedTop = 0
      FloatLeft = 590
      FloatTop = 232
      FloatClientWidth = 445
      FloatClientHeight = 106
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = []
      ItemLinks = <
        item
          UserDefine = [udWidth]
          UserWidth = 293
          Visible = True
          ItemName = 'beSelectPodr'
        end
        item
          BeginGroup = True
          Visible = True
          ItemName = 'bDate'
        end
        item
          BeginGroup = True
          Visible = True
          ItemName = 'beDateOts'
        end
        item
          Visible = True
          ItemName = 'bbsearch1'
        end
        item
          BeginGroup = True
          Visible = True
          ItemName = 'dxBarButton2'
        end
        item
          Visible = True
          ItemName = 'bbService'
        end
        item
          Visible = True
          ItemName = 'dxBarButton3'
        end>
      NotDocking = [dsNone, dsLeft, dsTop, dsRight, dsBottom]
      OneOnRow = True
      RotateWhenVertical = False
      Row = 0
      SizeGrip = False
      UseOwnFont = True
      UseRestSpace = True
      Visible = True
      WholeRow = False
    end
    object bbAddEditDoljnost: TdxBarButton
      Caption = #1044#1086#1083#1078#1085#1086#1089#1090#1085#1086#1077' '#1088#1072#1089#1087#1080#1089#1072#1085#1080#1077
      Category = 0
      Hint = #1056#1077#1076#1072#1082#1090#1080#1088#1086#1074#1072#1085#1080#1077' '#1076#1086#1083#1078#1085#1086#1089#1090#1077#1081
      Visible = ivAlways
      ImageIndex = 50
      PaintStyle = psCaptionGlyph
    end
    object beSelectPodr: TcxBarEditItem
      Caption = #1042#1099#1073#1086#1088' '#1087#1086#1076#1088#1072#1079#1076#1077#1083'.:'
      Category = 0
      Hint = #1042#1099#1073#1086#1088' '#1087#1086#1076#1088#1072#1079#1076#1077#1083'.'
      Visible = ivAlways
      OnChange = beSelectPodrChange
      ShowCaption = True
      Width = 300
      PropertiesClassName = 'TcxButtonEditProperties'
      Properties.Buttons = <
        item
          Default = True
        end>
      Properties.IncrementalSearch = False
      Properties.ReadOnly = True
      Properties.OnButtonClick = beSelectPodrPropertiesButtonClick
      InternalEditValue = ''
    end
    object bDate: TcxBarEditItem
      Caption = #1053#1072' '#1076#1072#1090#1091':'
      Category = 0
      Hint = #1044#1072#1090#1072' '#1085#1072#1093#1086#1078#1076#1077#1085#1080#1103' '#1088#1077#1073#1077#1085#1082#1072' '#1074' '#1087#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1080
      Visible = ivAlways
      ShowCaption = True
      Width = 150
      PropertiesClassName = 'TcxDateEditProperties'
      Properties.OnChange = bDatePropertiesChange
      InternalEditValue = 40921d
    end
    object bbsearch1: TdxBarButton
      Caption = #1048#1089#1082#1072#1090#1100
      Category = 0
      Enabled = False
      Hint = #1048#1089#1082#1072#1090#1100
      Visible = ivAlways
      ImageIndex = 53
      PaintStyle = psCaptionGlyph
      OnClick = bbsearch1Click
    end
    object dxBarButton2: TdxBarButton
      Align = iaRight
      Caption = 'New Button'
      Category = 0
      Hint = #1069#1082#1089#1087#1086#1088#1090' '#1074' Excel'
      Visible = ivAlways
      ImageIndex = 48
      OnClick = dxBarButton2Click
    end
    object dxBarButton3: TdxBarButton
      Align = iaRight
      Caption = #1042#1080#1076#1080#1084#1086#1089#1090#1100' '#1082#1086#1083#1086#1085#1086#1082
      Category = 0
      Hint = #1042#1080#1076#1080#1084#1086#1089#1090#1100' '#1082#1086#1083#1086#1085#1086#1082
      Visible = ivAlways
      ImageIndex = 17
      OnClick = dxBarButton3Click
    end
    object bbService: TdxBarButton
      Category = 0
      Visible = ivNever
      ImageIndex = 60
      OnClick = bbServiceClick
    end
    object beDateOts: TcxBarEditItem
      Caption = #1044#1072#1090#1072' '#1086#1090#1089#1091#1090#1089#1090#1074#1080#1103' '#1074' '#1087#1086#1076#1088#1072#1079#1076'.'
      Category = 0
      Hint = #1044#1072#1090#1072' '#1086#1090#1089#1091#1090#1089#1090#1074#1080#1103' '#1074' '#1087#1086#1076#1088#1072#1079#1076'.'
      Visible = ivAlways
      ShowCaption = True
      Width = 100
      PropertiesClassName = 'TcxDateEditProperties'
      Properties.OnChange = beDateOtsPropertiesChange
    end
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    BufferChunks = 10000
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT P.PLASTNAME, P.PNAME, P.PPATRONYMIC, p.PDATEBIRTH, P.PID,' +
        ' (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' '#39')||'#39' '#39'||CO' +
        'ALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP, '
      'IIF((DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) < 0, D' +
        'ATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)-1, '
      'DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)) as let, '
      'IIF( (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) < 0, 1' +
        '2 + (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)), (DATE' +
        'DIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) ) as m' +
        'es, '
      ' dp_prisut.SDNAME AS OSN_PODR,'
      'AGR.AGID, AGR.AGDATEBEGIN, agr.AGDATEEND,'
      'CASE AGR.AGPODRTYPE '
      ' WHEN 0 THEN '#39#1044'/'#1089#39' '
      ' WHEN 1 THEN '#39#1053#1072#1095'. '#1075#1080#1084#1085'.'#39' '
      ' WHEN 2 THEN '#39#1057#1088#1077#1076#1085'. '#1096#1082'.'#39' '
      ' WHEN 3 THEN '#39#1057#1090#1072#1088#1096'. '#1096#1082'.'#39' '
      ' WHEN 4 THEN '#39#1051#1072#1075#1077#1088#1100#39' '
      ' END AS agr_type '
      ''
      'FROM PEOPLE P '
      'LEFT OUTER JOIN P_STATUS PS on PS.PID = P.PID '
      ''
      'LEFT OUTER JOIN  '
      '(  '
      
        'SELECT APU11.PID, AGR1.AGID, AGR1.AGDATEBEGIN, AGR1.AGDATEEND, A' +
        'GR1.AGPODRTYPE  '
      'FROM AGR_POLUCH_USLUG APU11  '
      'LEFT OUTER JOIN AGREEMENTS AGR1 ON AGR1.AGID = APU11.AGID  '
      'WHERE CURRENT_DATE BETWEEN AGR1.AGDATEBEGIN AND AGR1.AGDATEEND  '
      'AND AGR1.AGISDELETE IS NULL  '
      ') AS AGR ON AGR.PID = P.PID  '
      'LEFT OUTER JOIN ( '
      'SELECT APU.PID, dp.sdid, dp.DPDATEIN, dp.DPDATEOUT, sd.SDNAME '
      'FROM DETI_PODRAZD_SC DP '
      'INNER JOIN SPEC_COND SC ON SC.SCID = DP.SCID '
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID '
      'INNER JOIN SYS_DIC SD ON SD.SDID = DP.SDID '
      ' where DP.DPTYPE = 1 AND SC.SCISDELETE IS NULL'
      
        '  and ( ( dp.SDID in ( 1401, 1407, 1408, 1437, 1511, 1512, 1513,' +
        ' 1514, 1516, 1517, 1519, 1518, 1520, 1521, 1523, 1522, 1524, 152' +
        '7, 1528, 1529, 1530, 1525, 1526, 11851, 11852 ) )  )'
      
        '   and (:date_prisut BETWEEN CAST(dp.DPDATEIN AS DATE) AND  COAL' +
        'ESCE(CAST(dp.DPDATEOUT AS DATE), CURRENT_DATE))'
      ') as dp_prisut on dp_prisut.pid = P.PID'
      'LEFT OUTER JOIN ( '
      'SELECT APU.PID, dp.sdid, dp.DPDATEIN, dp.DPDATEOUT, sd.SDNAME '
      'FROM DETI_PODRAZD_SC DP '
      'INNER JOIN SPEC_COND SC ON SC.SCID = DP.SCID '
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID '
      'INNER JOIN SYS_DIC SD ON SD.SDID = DP.SDID '
      ' where DP.DPTYPE = 1 AND SC.SCISDELETE IS NULL '
      
        '  and ( ( dp.SDID in ( 1401, 1407, 1408, 1437, 1511, 1512, 1513,' +
        ' 1514, 1516, 1517, 1519, 1518, 1520, 1521, 1523, 1522, 1524, 152' +
        '7, 1528, 1529, 1530, 1525, 1526, 11851, 11852 ) )  )'
      
        '   and (:date_ots BETWEEN CAST(dp.DPDATEIN AS DATE) AND  COALESC' +
        'E(CAST(dp.DPDATEOUT AS DATE), CURRENT_DATE))'
      ') as dp_ots on dp_ots.pid = P.PID'
      'WHERE P.PISDELETE IS NULL'
      ' AND dp_prisut.SDNAME IS NOT NULL'
      ' AND dp_ots.SDNAME IS NULL'
      ' ORDER BY 2,1,3'
      '')
    GeneratorField.Field = 'TFID'
    Left = 304
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'date_prisut'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'date_ots'
        ParamType = ptUnknown
      end>
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleLET: TLargeintField
      FieldName = 'LET'
      ProviderFlags = []
    end
    object qPeopleMES: TLargeintField
      FieldName = 'MES'
      ProviderFlags = []
    end
    object qPeopleOSN_PODR: TIBStringField
      FieldName = 'OSN_PODR'
      ProviderFlags = []
      Size = 255
    end
    object qPeopleAGID: TIntegerField
      FieldName = 'AGID'
      Origin = '"AGREEMENTS"."AGID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object qPeopleAGDATEBEGIN: TDateField
      FieldName = 'AGDATEBEGIN'
      Origin = '"AGREEMENTS"."AGDATEBEGIN"'
    end
    object qPeopleAGDATEEND: TDateField
      FieldName = 'AGDATEEND'
      Origin = '"AGREEMENTS"."AGDATEEND"'
    end
    object qPeopleAGR_TYPE: TIBStringField
      FieldName = 'AGR_TYPE'
      ProviderFlags = []
      FixedChar = True
      Size = 10
    end
  end
  object qPeople_temp: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.PLASTNAME, P.PNAME, P.PPATRONYMIC, p.PDATEBIRTH, P.PID,' +
        ' (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' '#39')||'#39' '#39'||CO' +
        'ALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP, '
      'IIF((DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) < 0, D' +
        'ATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)-1, '
      'DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)) as let, '
      'IIF( (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) < 0, 1' +
        '2 + (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)), (DATE' +
        'DIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) - '
      
        '(DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) ) as m' +
        'es, '
      ' dp_prisut.SDNAME AS OSN_PODR,'
      'AGR.AGID, AGR.AGDATEBEGIN, agr.AGDATEEND,'
      'CASE AGR.AGPODRTYPE '
      ' WHEN 0 THEN '#39#1044'/'#1089#39' '
      ' WHEN 1 THEN '#39#1053#1072#1095'. '#1075#1080#1084#1085'.'#39' '
      ' WHEN 2 THEN '#39#1057#1088#1077#1076#1085'. '#1096#1082'.'#39' '
      ' WHEN 3 THEN '#39#1057#1090#1072#1088#1096'. '#1096#1082'.'#39' '
      ' WHEN 4 THEN '#39#1051#1072#1075#1077#1088#1100#39' '
      ' END AS agr_type '
      ''
      'FROM PEOPLE P '
      'LEFT OUTER JOIN P_STATUS PS on PS.PID = P.PID '
      ''
      'LEFT OUTER JOIN  '
      '(  '
      
        'SELECT APU11.PID, AGR1.AGID, AGR1.AGDATEBEGIN, AGR1.AGDATEEND, A' +
        'GR1.AGPODRTYPE  '
      'FROM AGR_POLUCH_USLUG APU11  '
      'LEFT OUTER JOIN AGREEMENTS AGR1 ON AGR1.AGID = APU11.AGID  '
      'WHERE CURRENT_DATE BETWEEN AGR1.AGDATEBEGIN AND AGR1.AGDATEEND  '
      'AND AGR1.AGISDELETE IS NULL  '
      ') AS AGR ON AGR.PID = P.PID  '
      'LEFT OUTER JOIN ( '
      'SELECT APU.PID, dp.sdid, dp.DPDATEIN, dp.DPDATEOUT, sd.SDNAME '
      'FROM DETI_PODRAZD_SC DP '
      'INNER JOIN SPEC_COND SC ON SC.SCID = DP.SCID '
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID '
      'INNER JOIN SYS_DIC SD ON SD.SDID = DP.SDID '
      ' where DP.DPTYPE = 1 AND SC.SCISDELETE IS NULL')
    GeneratorField.Field = 'TFID'
    Left = 304
    Top = 32
  end
  object SD1: TSaveDialog
    InitialDir = 'c:\'
    Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
    Left = 552
    Top = 120
  end
end
